from django.core.mail import send_mail
try:
    send_mail(
        '测试邮件主题',
        '这是一封测试邮件。',
        '1293223538@qq.com',
        ['18892689998@163.com'],
        fail_silently=False,
    )
    print("邮件发送成功!")
except Exception as e:
    print(f"邮件发送失败: {e}")
